import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '../views/home.vue')
  },
  {
    path: '/user',
    name: 'User',
    component: () => import(/* webpackChunkName: "User" */ '../views/user/index.vue')
  },
  {
    path: '/user/register/:registerId',
    name: 'UserRegister',
    component: () => import(/* webpackChunkName: "UserRegister" */ '../views/user/register/index.vue')
  },
  {
    path: '/user/update/:updateId',
    name: 'UserUpdate',
    component: () => import(/* webpackChunkName: "UserUpdate" */ '../views/user/update/index.vue')
  },
  {
    path: '/org',
    name: 'org',
    redirect:'/org/studentRegisterList',
    component: () => import(/* webpackChunkName: "org" */ '../views/org/index'),
    children:[
      // {
      //   path:'/',
      //   redirect:'/org/studentRegisterList'
      // },
      {
        path:'/org/studentRegisterList',
        name:'studentRegisterList',
        component: () => import(/* webpackChunkName: "studentRegisterList" */ '../views/org/studentRegisterList/index.vue')
      },
      {
        path:'/org/orgList',
        name:'orgList',
        component: () => import(/* webpackChunkName: "orgList" */ '../views/org/orgList/index.vue')
      },
      {
        path:'/org/examTime',
        name:'examTime',
        component: () => import(/* webpackChunkName: "examTime" */ '../views/org/examTime/index.vue')
      },
      {
        path:'/org/studentScore',
        name:'studentScore',
        component: () => import(/* webpackChunkName: "studentScore" */ '../views/org/studentScore/index.vue')
      }
    ]
  },
  {
    path: '/admin',
    name: 'admin',
    redirect:'/admin/studentRegisterList',
    component: () => import(/* webpackChunkName: "admin" */ '../views/admin/index'),
    children:[
      // {
      //   path:'/',
      //   redirect:'/admin/studentRegisterList'
      // },
      {
        path:'/admin/studentRegisterList',
        name:'adminStudentRegisterList',
        component: () => import(/* webpackChunkName: "adminStudentRegisterList" */ '../views/admin/studentRegisterList/index.vue')
      },
      {
        path:'/admin/orgList',
        name:'adminOrgList',
        component: () => import(/* webpackChunkName: "adminOrgList" */ '../views/admin/orgList/index.vue')
      },
      {
        path:'/admin/examTime',
        name:'adminExamTime',
        component: () => import(/* webpackChunkName: "adminExamTime" */ '../views/admin/examTime/index.vue')
      },
      {
        path:'/admin/studentScore',
        name:'adminStudentScore',
        component: () => import(/* webpackChunkName: "adminStudentScore" */ '../views/admin/studentScore/index.vue')
      }
    ]
  },
  {
    path: '/personCenter',
    name: 'PersonCenter',
    component: () => import(/* webpackChunkName: "user" */ '../views/user/personCenter/index.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
